package  
{
	import flash.display.Shape;
	import flash.geom.Matrix;
	import flash.geom.Rectangle;
	import org.flixel.*;
	/**
	 * ...
	 * @author morgan
	 */
	public class HitboxObject extends FlxSprite
	{
		public var HITBOX:Number = 4;	// Square with sides of this length		
		public var drawHitbox:Number = 0;
		public function HitboxObject(x:int, y:int, image:Class = null) 
		{
			super(x, y, image);	
		}
		
		override public function update():void 
		{
			super.update();
		}
		
		override public function draw():void 
		{
			super.draw();
			
			/*
			if (visible && exists && GameState.hitboxes > 0 && drawHitbox > 0)
			{
				var s:Shape = new Shape();
				//var c:uint = FlxU.makeColorFromHSB((GameState.hitboxes * 100) % 360, 1, 1);
				var c:uint = 0xffffffff;
				s.graphics.lineStyle(1, c, Math.min(GameState.hitboxes, 1.0));
				s.graphics.beginFill(0xff006c, Math.min(GameState.hitboxes, 1.0));
				s.graphics.drawRect(x - 1, y - 1, width + 2, height + 2);
				s.graphics.endFill();
				FlxG.camera.buffer.draw(s);
			}
			*/
			if (visible && exists && GameState.shiftHitbox)
			{
				//FlxG.camera.buffer.fillRect(new Rectangle(x-1, y-1, width+2, height+2), 0xffffff);
				//FlxG.camera.buffer.fillRect(new Rectangle(x, y, width, height), 0xff000000);
				var mtx:Matrix = new Matrix(1, 0, 0, 1, x - 2, y - 2);
				if (this == GameState.ref.player)
				{
					FlxG.camera.buffer.draw(GameState.ref.heart, mtx);
				}
				else if (this is Bullet)
				{
					if ((this as Bullet).type == GameState.ref.mode || (this as Bullet).type == Bullet.CANDY)									
					{
						FlxG.camera.buffer.draw(GameState.ref.check, mtx);
					}
					else if ((this as Bullet).type != Bullet.PLAYER)
					{
						FlxG.camera.buffer.draw(GameState.ref.dne, mtx);
					}
				}
			}
		}
	}

}